package com.course.web.model;

import com.course.domain.model.TaskGroup;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

/**
 * Created by Justin on 2017/6/11.
 */
@Data
@EqualsAndHashCode(of = {"id"})
public class TaskGroupVM implements HasID {
    @Min(0)
    private int id;
    @Min(0)
    private final int courseId;
    @Min(0)
    private int taskId;
    @Min(0)
    private int itemId;
    @Min(0)
    private int idx;
    @NotNull
    private TaskGroup.Type type;

    public String getTypeName() {
        return type.getTitle();
    }
}
